﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using AutumnEngine.Modules;
using System.Diagnostics;
using AutumnEngine;


namespace AutumnEngine.Modules
{
    public class AccelerometerInputModule : Module
    {        
#if ZUNE
        AccelerometerState current, last;
        public override void Create()
        {
            current = Accelerometer.GetState();
            last = current;
            base.Create();
        }

        public override void Update()
        {
            last = current;
            current = Accelerometer.GetState();
            base.Update();
        }

        public Vector3 CurrentAcceleration
        {
            get { return current.Acceleration; }
        }

        public Vector3 PreviousAcceleration
        {
            get { return last.Acceleration; }
        }

        public Vector3 Velocity
        {
            get { return current.Acceleration - last.Acceleration; }
        }

        //TODO orientation system.
#endif
    }
}
